package Graph;

public class Circle extends Graphics{
    private double r;
    public static double pi =3.1415;

    public double getR() {
        return r;
    }

    public void setR(double r) {
        this.r = r;
    }
    public Circle(){

    }

    public Circle(String color,boolean fill,double r){
        super(color,fill);
        this.r=r;
        if (fill != true){
            System.out.print("无填充  ");
        }else {
            System.out.print("有填充  ");
        }
        System.out.println(toString());
    }

    public String toString(){
        return "圆形颜色为"+getColor()+"  面积为"+r*r*pi;
    }
}
